<!-- 开发登录账号 -->
<template>
    <div>
        <div class="table-page-search-wrapper">
            <a-form :label-col="{ span: 5 }" :wrapper-col="{ span: 10 }">
                <!-- <a-form-item label="品牌">
                    <a-select v-model="brandId" show-search placeholder="请选择品牌" allowClear>
                        <a-select-option v-for="(item,i) in brandList" :key="i" :value="item.id">{{item.brandName}}({{item.id}})</a-select-option>
                    </a-select>
                </a-form-item> -->
                <a-form-item label="手机号">
                    <a-input v-model="account" placeholder="请输入要登录的手机号" allow-clear></a-input>
                </a-form-item>
                <a-form-item  v-bind="formItemLayoutWithOutLabel">
                    <a-button type="primary" @click="submit">确定</a-button>
                </a-form-item>
            </a-form>
        </div>
    </div>
</template>

<script>
import { setUserIgnorePassword } from '@/api/power';
export default {
    data () {
        return {
            brandId: this.global.brandId,
            brandList: [],
            account: '',
            formItemLayoutWithOutLabel: {
                wrapperCol: {
                    xs: { span: 24, offset: 0 },
                    sm: { span: 20, offset: 5 },
                },
            },
        };
    },
    created(){
        // this.getBrand()
    },
    methods: {
        submit(){
            let _this = this
            if(!_this.brandId){
                _this.$message.warning('请先选择品牌！')
                return
            }
            if(_this.account == '' || _this.account.length != 11){
                _this.$notification['error']({
                    message: '提示',
                    description: '请输入正确的手机号！',
                    duration: 8,
                })
                return
            }
            const params = {
                'brandId':_this.brandId,
                'account':_this.account,
            }
            setUserIgnorePassword(params)
            .then(res=>{
                if(res.success){
                    _this.$notification['success']({
                        message: '提示',
                        description: '设置成功',
                        duration: 8,
                    })
                }else{
                    _this.$notification['error']({
                        message: '提示',
                        description: res.errMessage,
                        duration: 8,
                    })
                }
            })
        },
    }
}

</script>
<style scoped>

</style>